<?php

namespace App\Jobs;

use App\Plugins\Sms\SendInfo;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class SendSms implements ShouldQueue
{
    use InteractsWithQueue, Queueable, SerializesModels;

    protected $_sms;

    /**
     * 创建新的作业实例
     * Create a new job instance.
     * SendSms constructor.
     * @param $_data
     */
    public function __construct($_data)
    {
        $this->_sms = $_data;
    }

    /**
     * 执行任务
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        $sendInfo = new SendInfo();
        $sendInfo->Send($this->_sms['_code'], $this->_sms['_filter'], implode(',', $this->_sms['_mobiles']), null, null);
    }
}
